import java.sql.Connection;

public abstract class RankManager {

	private Connection connection;

	public RankManager(Connection initConnection) {
		// constructor - initialiaze connection
		// use this connection in all functions

		setConnection(initConnection);
	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	public abstract void loadRankTypes() throws DBManagerException;

	// Load data from Rank Type table to the MAP ( key , value )
	// where kye is rank column
	// value is Rank Object ( rank_name,credit,comission,min_start_deposit)

	public abstract Long getRankByMoneyAmount(double moneyAmount);

	// Get rank by money Amount
	// function receive moneyAmount
	// return appropriate rank ( key for rankTypes MAP )
	// we select this Rank by compare min_start_deposit with moneyAmount

	public abstract Account getComissionAndCreditForAccount(Account account);

	// get updated Account object with Comission and Credit inform
	// function receive Account object
	// select appropriate Comission and Credit data from rankType MAP
	// by conpare min_start_deposit with moneyAmount for current account

}
